<include file="Public/header" />
<include file="Public/menu" />
<link rel="stylesheet" href="/Public/admin/adminlte/bootstrap/css/bootstrap-switch.min.css">

<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
            分销
            <small>管理</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="{:U('Distribution/memberList')}"><i class="fa fa-dashboard"></i> 分销</a></li>
            <li><a href="{:U('Distribution/memberList')}"><i class="fa fa-dashboard"></i> 分销人员列表</a></li>
            <li class="active">奖金记录</li>
        </ol>
    </section>

    <!-- 内容 -->
    <section class="content">

        <div class="row"><div class="col-md-12"><div class="nav-tabs-custom">
            <ul class="nav nav-tabs">
                <li class="<?php echo $_GET['type'] == '0' ? 'active': '';?>"><a href="/Qgs/Distribution/bonusRecord/member_id/<?php echo $_GET['member_id'];?>/type/0">奖金获得记录</a></li>
                <li class="<?php echo $_GET['type'] == '1' ? 'active': '';?>"><a href="/Qgs/Distribution/bonusRecord/member_id/<?php echo $_GET['member_id'];?>/type/1">奖金使用记录</a></li>
                <li class="<?php echo $_GET['type'] == '' ? 'active': '';?>"><a href="/Qgs/Distribution/bonusRecord/member_id/<?php echo $_GET['member_id'];?>">全部</a></li>


                <li class="pull-right header"></li>
            </ul>
            <div class="tab-content">

                <div class="tab-pane active" id="tab_0">
                    <div class="box">

                        <!-- /.box-header -->
                        <div class="box-body table-responsive no-padding">
                            <table class="table table-hover" style="width: 100%;">
                                <tr>
                                    <th>ID
                                    </th>
                                    <th>昵称</th>
                                    <th>下级昵称</th>
                                    <th>时间</th>
                                    <th>信息</th>
                                    <th>金额</th>
                                </tr>
                                <foreach name="msg" item="v" >
                                    <tr>
                                        <td>{$v.id}</td>
                                        <td>{:get_member_msg($v['member_id'])}</td>
                                        <td>{:get_member_msg($v['s_member_id'])}</td>
                                        <td>{:date("Y-m-d H:i:s", $v['time'])}</td>
                                        <td>{$v.msg}</td>
                                        <td style="<?php echo ($v['type'] == '0') ? 'color: green': 'color: red'; ?>">{$v.change_num}</td>
                                    </tr>
                                </foreach>
                                </tbody>
                            </table>
                        </div>
                        <div class="box-footer clearfix">
                            <!--<input type="checkbox" class="grid-select-all">&nbsp;&nbsp;&nbsp;-->
                            <!--<a class="btn btn-sm btn-danger batch-delete">批量删除</a>-->

                            <!--<a class="btn btn-sm btn-primary grid-refresh"><i class="fa fa-refresh"></i></a>-->

                            <ul class="pagination pagination-sm no-margin pull-right">    </ul>
                            {$show}
                        </div>
                        <!-- /.box-body -->
                    </div>

                </div>

                <div class="tab-pane " id="tab_">
                    <div class="box">
                        <div class="box-body table-responsive no-padding">
                        </div>
                    </div>
                </div>


            </div>
        </div></div></div>

    </section>
</div>
<!-- 底部 -->
<include file="Public/common_footer" />
<script src="__PUBLIC__/admin/adminlte/bootstrap/js/bootstrap-switch.min.js"></script>
<script src="/Public/layer/layer.js"></script>
<script>
    $('.exchange-code').click(function () {
        var href = $(this).attr('href-data');
        layer.ready(function(){
            layer.open({
                type: 2,
                title: '添加产品列表',
                fix: false,
                maxmin: true,
                shadeClose: true,
                area: ['1100px', '800px'],
                content: href,
                end: function(){
                    layer.tips('Hi', '#about', {tips: 1})
                }
            });
        });
    });


    $(function(argument) {
        $('.grid-select-all').change(function () {
            if (this.checked) {
                $('.grid-item').prop("checked", true);
            } else {
                $('.grid-item').prop("checked", false);
            }
        });

        $('.switch [type="checkbox"]').bootstrapSwitch();

        $('input[name="status"]').on('switchChange.bootstrapSwitch', function (event, status) {
            var id = $(this).attr('data-id');
            $.ajax({
                type: 'get',
                url: "{:U('change')}",
                data: {id: id, status: status},
                success: function (msg) {

                },
                error: function (msg) {
                    alert(msg.message);
                }
            })
        });
        $('input[name="adverts"]').on('switchChange.bootstrapSwitch', function (event, status) {

            $.ajax({
                type: 'get',
                url: "{:U('isopen')}",
                data: {status: status},
                success: function (msg) {
                },
                error: function (msg) {
                    alert(msg.message);
                }
            })
        });

    })
</script>








